<!--
 * @Author: whq
 * @Date: 2025-03-09 17:26:17
 * @LastEditTime: 2025-03-25 10:23:47
 * @LastEditors: whq
 * @Description: 
 * @FilePath: /uniapp_build_mate_profit_mini/pages/publish/index.vue
-->
<template>
  <view>
    <uv-grid :col="3" @click="uvGridClick" :border="true">
      <uv-grid-item
        v-for="(item, index) in baseList"
        :key="index"
        :customStyle="{ padding: '20rpx' }"
      >
        <uv-icon
          :customStyle="{ paddingTop: 16 + 'rpx' }"
          :name="item.icon"
          :size="26"
        ></uv-icon>
        <text class="grid-text">{{ item.title }}</text>
      </uv-grid-item>
    </uv-grid>
  </view>
</template>

<script setup>
import { ref } from "vue";

const baseList = ref([
  {
    icon: "photo",
    title: "新增入库单",
    path: "/pagesStock/inStockAddDetails/index?type=add",
  },
  {
    icon: "photo",
    title: "新增出库单",
    path: "/pagesOrder/outStockAddDetails/index?type=add",
  },
  {
    icon: "photo",
    title: "出库单批量收款",
    path: "/pagesPayment/index?type=outStockPayment",
  },
  {
    icon: "photo",
    title: "入库单批量付款",
    path: "/pagesPayment/index?type=inStockPayment",
  },
]);

const uvGridClick = (index) => {
  console.log(index, "====index");
  let targetBase = baseList.value[index];
  console.log(targetBase, "===targetBase===");
  uni.navigateTo({
    url: targetBase.path,
  });
};
</script>

<style scoped lang="scss">
.grid-text {
  font-size: 14px;
  color: #909399;
}
</style>
